package com.longge;

/**
 * @program: my-code
 * @description:
 * @author: longge
 * @create: 2021-05-19 21:32
 */
public class WaysToStep {

    public int waysToStep(int n) {

        int[] dp = new int[n + 1];
        dp[0]=1;
        for (int i = 1; i <= n; i++) {
            for (int j = 1; j <= 3; j++) {
                if (i - j >= 0) {
                    dp[i] +=  dp[i - j];
                    dp[i] %= 1000000007;
                }
            }
        }
        return dp[n];
    }

    public static void main(String[] args) {
        new WaysToStep().waysToStep(3);
    }
}
